const jwt = require('jsonwebtoken');
class Token {
    constructor() {
        this.secretKey = 'your-secret-key';
    }
    createToken(user){
        return jwt.sign(user, this.secretKey, { expiresIn: '24h' });
    };
    verifyToken(token){
        try {
            return jwt.verify(token, this.secretKey);
        } catch (err) {
            return false;
        }
    };

}
module.exports = Token